147 - Dollars (Programación dinámica, DP, coin change)
[andmenj-acm.git] / 10696 - f91 / 10696.cpp
blob53a8ae9f7bd8eb207716914303e5f5e262fc1845
1 /*
2 Accepted
3 */
4 #include <stdio.h>
6 int f[1000001];
8 int main(int argc, char const *argv){
9 for (int i = 1000000; i > 100; --i){
10 f[i] = i-10;
12 for (int i = 100; i > 0; --i){
13 f[i] = f[f[i+11]];
16 int n;
17 while (scanf("%d", &n) == 1 && n){
18 printf("f91(%d) = %d\n", n, f[n]);
21 return 0;